<!-- 图片属性弹窗编辑器 -->
<template>
  <div>
    <el-dialog @close="close" title="图片属性设置" :visible.sync="dialogFormVisible" width="600px">
      <el-row>
        <el-col :span="24">
          <el-form :label-width="formLabelWidth">
            <el-form-item label="alt 属性" style="margin-bottom:0px;">
              <el-input size="small" v-model="image.alt" maxlength="64" placeholder="alt">
              </el-input>
            </el-form-item>
            <el-form-item label="title 属性" style="margin-bottom:0px;">
              <el-input size="small" v-model="image.title" maxlength="64" placeholder="title">
              </el-input>
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="dialogFormVisible = false">取 消</el-button>
        <el-button size="mini" type="primary" @click="ok">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    width: {
      type: String,
      default: '320px'
    }
  },
  data () {
    return {
      dialogFormVisible: false,
      formLabelWidth: '100px',
      image: {
        alt: '',
        title: '',
        caption: ''
      },
      callback: () => { }
    }
  },
  methods: {
    close () {
      this.image = {
        alt: '',
        title: ''
      }
      this.callback = () => { }
    },
    open (lk, callback) {
      this.image = lk
      this.callback = callback
      this.dialogFormVisible = true
    },
    ok () {
      this.callback(this.image)
      this.dialogFormVisible = false
    }
  }
}

</script>
<style scoped>
</style>
